package com.ease.common.enums;


public enum StatusEnum implements ValuableEnum {
	ON((short) 1), //
	OFF((short) 2); //

	private short value;

	private StatusEnum(short value) {
		this.value = value;
	}

	public final static StatusEnum get(short value) {
		return EnumUtil.get(StatusEnum.class, value, OFF);
	}

	public final static StatusEnum get(String name) {
		return EnumUtil.get(StatusEnum.class, name);
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name();
	}

	/**
	 * @return the value
	 */
	public short getValue() {
		return value;
	}

	public static void main(String[] args) {
		StatusEnum statusEnum = EnumUtil.get(StatusEnum.class, "ON");
		System.out.println(statusEnum);
		statusEnum = EnumUtil.get(StatusEnum.class, (short) 1);
		System.out.println(statusEnum);
	}

}
